﻿using System.Globalization;
using System.Threading;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
using System.Windows.Media.Imaging;
using System;

namespace OutLook.UI.WPFApp.Helpers
{
    public static class ApplicationCulture
    {
        #region Constants

        public const string RU = "ru-RU";
        public const string EN = "en-US";

        #endregion

        #region Public Properties

        public static string Culture
        {
            get
            {
                return m_Culture;
            }
            set
            {
                m_Culture = value;
            }
        }

        public static System.Uri PictureSource
        {
            get
            {

                if (Culture.Equals(RU))
                    return new System.Uri(@"pack://application:,,,/RU.jpg", UriKind.Absolute);

                if (Culture.Equals(EN))
                    return new System.Uri("/OutLook.UI.WPFApp;component/Resources/US.jpg");

                return new System.Uri(string.Empty);
            }
        }

        #endregion

        #region Public Methods

        public static void SetCulture()
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(ApplicationCulture.Culture);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Thread.CurrentThread.CurrentUICulture.Name);
        }

        #endregion

        #region Fields

        private static string m_Culture = RU;

        #endregion
    }
}